//
//  CoModel.h
//  家校互通
//
//  Created by 姬鑫宇 on 15/4/21.
//  Copyright (c) 2015年 姬鑫宇. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "AFAppDotNetAPIClient.h"
#import <AFNetworking.h>
@class BlackBoardDetail;
@class ChartDetail;
@class PaymentDetail;
@interface CoModel : NSObject
//--获取黑板报
+ (NSURLSessionDataTask *)blackboardGetNews:(void (^)(BOOL result,NSArray *array,NSError *error))block withtoken:(NSString *)token clazzId:(NSInteger)clazzId withPageNumber:(NSInteger)pageNumber withPageSize:(NSInteger)pageSize;
//--发请假条
+ (NSURLSessionDataTask *)leaveApply:(void (^)(BOOL result,NSString *failMessage,NSError *error))block withType:(NSInteger)type withTitle:(NSString *)title withContent:(NSString *)content;
//--获取消息详情
+ (NSURLSessionDataTask *)getChartDetail:(void (^)(BOOL result,ChartDetail *model,NSError *error))block withChartId:(NSInteger) chartId;
//--获取聊天记录
+ (NSURLSessionDataTask *)getMessages:(void (^)(BOOL result,NSArray *msgList,NSError *error))block withChartId:(NSInteger)chartId;
//--获取黑板报详情
+ (NSURLSessionDataTask *)getNewsDetail:(void (^)(BOOL result,BlackBoardDetail *model,NSError *error))block withBlackboardId:(NSInteger)blackboardId withPageNumber:(NSInteger)pageNumber withPageSize:(NSInteger)pageSize;

/**
 *  --活动专题列表
 *
 *  @param block
 *  @param token      登录令牌
 *  @param clazzId    班级id
 *  @param pageNumber 页码，页码从0开始，默认值“0”
 *  @param pageSize   每页显示条数，默认值“5”
 *
 *  @return
 */
+ (NSURLSessionDataTask *)getActivitys:(void (^)(BOOL result,NSMutableArray *arrayList,NSError *error))block withtoken:(NSString *)token clazzId:(NSInteger)clazzId withPageNumber:(NSInteger)pageNumber withPageSize:(NSInteger)pageSize;

//--发布黑板报
+ (NSURLSessionDataTask *)createNews:(void (^)(BOOL result,NSString *failMessage,NSError *error))block withType:(NSInteger)type withTitle:(NSString *)title withContent:(NSString *)content withIsTop:(NSInteger)isTop withImages:(NSArray *)images withVisibleRange:(NSInteger)visibleRange withIsAllowComment:(NSInteger)isAllowComment withStudentId:(NSInteger)studentId withRegistrationMode:(NSInteger)registrationMode withUsers:(NSString *)users;
//--获取请假条列表
+ (NSURLSessionDataTask *)getLeaves:(void (^)(BOOL result,NSArray *leavesArray,NSError *error))block;
//--写评论
+ (NSURLSessionDataTask *)comment:(void (^)(BOOL result,NSError *error))block withBlackboardId:(NSInteger)blackboardId withReceiverId:(NSInteger)receiverId withContent:(NSString *)content;
//--获取评论列表
+ (NSURLSessionDataTask *)getComments:(void (^)(BOOL result,NSArray *array,NSError *error))block withBlackboardId:(NSInteger)blackboardId withPageNumber:(NSInteger)pageNumber withPageSize:(NSInteger)pageSize;

//--修改黑板报读取、收藏、报名等相关信息
+ (NSURLSessionDataTask *)modifyRelation:(void (^)(BOOL result,NSError *error))block withBlackboardId:(NSInteger)blackboardId withType:(NSInteger)type withStatus:(NSInteger)status;
//--获取班级聊天室、获取聊天室信息
+ (NSURLSessionDataTask *)getClazzCharts:(void (^)(BOOL result,NSMutableArray *roomList, NSError *error))block withToken:(NSString *)token andClassId:(NSInteger) classId;
//获取手环绑定的信息
+ (NSURLSessionDataTask *)getWristbands:(void (^)(BOOL result,NSMutableArray *wristbands, NSError *error))block;
//发起收费
+ (NSURLSessionDataTask *)payInitiate:(void (^)(BOOL result,NSMutableArray *wristbands, NSError *error))block andType:(NSInteger)type andTitle:(NSString *)title andContent:(NSString *)content andFee:(float)fee andVisibleRange:(NSInteger)visibleRange andStudentIds:(NSString *)studentIds;
//获取收费列表
+ (NSURLSessionDataTask *)getPayments:(void (^)(BOOL result,NSMutableArray *payments, NSError *error))block andPageNumber:(NSInteger)pageNumber andPageSize:(NSInteger)pageSize;
//获取收费详情
+ (NSURLSessionDataTask *)getPaymentDetail:(void (^)(BOOL result,PaymentDetail *paymentDetail, NSError *error))block andPaymentId:(NSInteger)paymentId;

//修改用户信息
+ (NSURLSessionDataTask *)modify:(void (^)(BOOL result,NSString *failMessage,NSError *error))block withIcon:(NSString *)icon andPushId:(NSString *)pushId;
//--获取班级学生信息
+ (NSURLSessionDataTask *)getClazzStudents:(void (^)(BOOL result,NSMutableArray *roomList, NSError *error))block withToken:(NSString *)token andClassId:(NSInteger) classId;

+ (NSURLSessionDataTask *)getChartUsers:(void (^)(BOOL result,NSMutableArray *roomList, NSError *error))block withToken:(NSString *)token andChartId:(NSInteger) chartId;
#pragma -mark ----------------------图片上传---------------------
//--发送图片
+ (AFHTTPRequestOperation *)uploadImage:(void (^)(BOOL result,NSMutableArray *imageUrlList, NSError *error))block withImage:(NSArray *)imageArray andType:(NSInteger)type;
//--上传头像
//+ (AFHTTPRequestOperation *)uploadIcon:(void (^)(BOOL result,NSString *imageUrl, NSError *error))block withImage:(UIImage *)image;


@end

@interface BlackBoardModel : MTLModel

@property (nonatomic, assign) NSInteger clazz_id;
@property (nonatomic, assign) NSInteger comment_count;
@property (nonatomic, retain) NSString  *content;
@property (nonatomic, assign) NSInteger create_by;
@property (nonatomic, retain) NSString  *create_time;
@property (nonatomic, retain) NSString  *icon;
@property (nonatomic, retain) NSString  *nickname;
@property (nonatomic, assign) NSInteger id;
@property (nonatomic, retain) NSArray   *images;
@property (nonatomic, assign) NSInteger is_allow_comment;
@property (nonatomic, assign) NSInteger is_top;
@property (nonatomic, assign) NSInteger notify_count;
@property (nonatomic, assign) NSInteger read_count;
@property (nonatomic, assign) NSInteger registration_count;/**<已经报名的数量*/
@property (nonatomic, retain) NSString  *title;
@property (nonatomic, assign) NSInteger type;/**<黑板报类型,1-作业,2-表彰,3-通知,4-活动,5-收费,6-公告*/
@property (nonatomic, assign) NSInteger visible_range;
@property (nonatomic, assign) NSInteger registration_mode;/**<活动参与方式,1-直接参与,2-需要报名,当type=活动时有效*/
@end

@interface BlackBoardDetail : MTLModel

@property (nonatomic, assign) NSInteger clazz_id;
@property (nonatomic, assign) NSInteger comment_count;
@property (nonatomic, retain) NSString  *content;
@property (nonatomic, retain) NSString  *create_time;
@property (nonatomic, assign) NSInteger create_by;
@property (nonatomic, retain) NSString  *icon;
@property (nonatomic, retain) NSArray   *images;

@property (nonatomic, assign) NSInteger is_allow_comment;
@property (nonatomic, assign) NSInteger is_top;
@property (nonatomic, retain) NSString  *nickname;

@property (nonatomic, assign) NSInteger notify_count;
@property (nonatomic, assign) NSInteger read_count;
@property (nonatomic, assign) NSInteger registration_count;
@property (nonatomic, assign) NSInteger type;/**<黑板报类型,1-作业,2-表彰,3-通知,4-活动,5-收费,6-公告*/
@property (nonatomic, assign) NSInteger visible_range;
@property (nonatomic, retain) NSString  *title;

@property (nonatomic, assign) NSInteger is_collect;
@property (nonatomic, assign) NSInteger student_id;/**<被表彰的学生,当type='表彰'时有效*/
@property (nonatomic, strong) NSString *student_name;/**<被表彰的学生,当type='表彰'时有效*/
@property (nonatomic, assign) NSInteger registration_mode;/**<活动参与方式,1-直接参与,2-需要报名,当type=活动时有效*/
@property (nonatomic, retain) NSArray   *readers;
@property (nonatomic, retain) NSArray   *comments;
@end

@interface CommentListModel : MTLModel

@property (nonatomic, assign) NSInteger sender_id;
@property (nonatomic, assign) NSInteger receiver_id;
@property (nonatomic, retain) NSString  *create_time;
@property (nonatomic, retain) NSString  *content;
@end

@interface ReaderListModel : MTLModel
@property (nonatomic, assign) NSInteger id;
@property (nonatomic, retain) NSString  *icon;
@end

@interface NewsListModel : MTLModel

@property (nonatomic, retain) NSString  *create_time;
@property (nonatomic, assign) NSInteger id;
@property (nonatomic, retain) NSString  *title;
@property (nonatomic, assign) NSInteger type;
@property (nonatomic, retain) NSString  *content;
@property (nonatomic, assign) NSInteger msg_count;
@property (nonatomic, retain) NSString *last_msg_time;

@end

@interface ChartDetail : MTLModel

@property (nonatomic, retain) NSString  *create_time;
@property (nonatomic, assign) NSInteger id;
@property (nonatomic, retain) NSString  *title;
@property (nonatomic, assign) NSInteger type;
@property (nonatomic, retain) NSString  *content;
@property (nonatomic, retain) NSArray   *chart_users;
@property (nonatomic, retain) NSArray   *messages;

@end

@interface ChartUser : MTLModel

@property (nonatomic, assign) NSInteger id;
@property (nonatomic, assign) NSInteger is_admin;
@property (nonatomic, assign) NSInteger is_creator;
@property (nonatomic, assign) NSInteger sex;
@property (nonatomic, assign) NSInteger is_master;
@property (nonatomic, retain) NSString  *icon;
@property (nonatomic, retain) NSString  *nickname;

@end


@interface TalkMessage : MTLModel

@property (nonatomic, assign) NSInteger id;
@property (nonatomic, assign) NSInteger type;
@property (nonatomic, assign) NSInteger chart_id;
@property (nonatomic, assign) NSInteger sender_id;
@property (nonatomic, assign) NSInteger receiver_id;
@property (nonatomic, retain) NSString  *sender_nickname;
@property (nonatomic, retain) NSString  *receiver_nickname;
@property (nonatomic, retain) NSString  *sender_icon;
@property (nonatomic, retain) NSString  *receiver_icon;
@property (nonatomic, retain) NSString  *content;
@property (nonatomic, retain) NSString  *msg_time;
@property (nonatomic, retain) NSString  *chart_title;

@end

@interface ContentModel : MTLModel

@property (nonatomic, assign) NSInteger sender_id;
@property (nonatomic, assign) NSInteger receiver_id;
@property (nonatomic, retain) NSString  *sender_nickname;
@property (nonatomic, retain) NSString  *receiver_nickname;
@property (nonatomic, retain) NSString  *content;
@property (nonatomic, retain) NSString  *create_time;

@end
// Int	班级id
@interface ClazzStudents : MTLModel
@property (nonatomic, assign) NSInteger id;
@property (nonatomic, retain) NSString *name;
@property (nonatomic, assign) NSInteger sex;
@end

@interface Wristbands : MTLModel

@property (nonatomic, assign) NSInteger id;
@property (nonatomic, retain) NSString *name;
@property (nonatomic, assign) NSInteger sex;
@property (nonatomic, assign) NSInteger role;
@property (nonatomic, assign) NSInteger user_type;
@property (nonatomic, retain) NSString *wristband_sn;

@end

@interface Payments : MTLModel

@property (nonatomic, assign) NSInteger id;
@property (nonatomic, retain) NSString *title;
@property (nonatomic, assign) NSInteger type;
@property (nonatomic, assign) float fee;
@property (nonatomic, assign) NSInteger visibleRange;
@property (nonatomic, retain) NSString *content;
@property (nonatomic, retain) NSString *createTime;

@end

@interface PaymentDetail : MTLModel

@property (nonatomic, retain) NSString *title;
@property (nonatomic, assign) NSInteger type;/**<缴费类型,1-学杂费,2-活动报名费*/
@property (nonatomic, assign) float fee;
@property (nonatomic, assign) NSInteger visibleRange;
@property (nonatomic, retain) NSString *content;
@property (nonatomic, assign) int isFinish;
@property (nonatomic, retain) NSString *createTime;
@property (nonatomic, assign) int payStatus;

@end
